Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split dynamic shape parsing update #3034

Merged
merged 20 commits into from
May 31, 2024
Merged

Split dynamic shape parsing update #3034

merged 20 commits into from
May 31, 2024

Conversation

CharlieL7
Copy link
Collaborator

@CharlieL7 CharlieL7 commented May 3, 2024

  • Updates parsing of Split ONNX operator to support dynamic shapes
    • If splitting over a fixed dynamic dimension we can use the original parsing
    • For splitting over a non-fixed dynamic dimension we must do shape calculations in the graph
      • Currently only supports the case of no split attribute or input
      • Should be possible to extend dynamic shape support to other cases in the future

@CharlieL7 CharlieL7 self-assigned this May 3, 2024
Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.94%. Comparing base (b9cce08) to head (fb7fa55).
Report is 148 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3034      +/-   ##
===========================================
+ Coverage    91.92%   91.94%   +0.01%     
===========================================
  Files          489      489              
  Lines        19275    19309      +34     
===========================================
+ Hits         17719    17753      +34     
  Misses        1556     1556              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@migraphx-bot
Copy link
Collaborator

migraphx-bot commented May 3, 2024

Test Batch Rate new
fb7fa5
Rate old
716da6
Diff Compare
torchvision-resnet50 64 1,713.20 1,714.31 -0.06%
torchvision-resnet50_fp16 64 3,810.68 3,811.27 -0.02%
torchvision-densenet121 32 1,452.47 1,453.18 -0.05%
torchvision-densenet121_fp16 32 2,436.48 2,438.60 -0.09%
torchvision-inceptionv3 32 882.73 883.47 -0.08%
torchvision-inceptionv3_fp16 32 1,411.66 1,415.00 -0.24%
cadene-inceptionv4 16 407.28 407.87 -0.15%
cadene-resnext64x4 16 413.83 413.67 0.04%
slim-mobilenet 64 3,824.11 3,822.63 0.04%
slim-nasnetalarge 64 97.02 97.02 -0.00%
slim-resnet50v2 64 1,651.41 1,651.78 -0.02%
bert-mrpc-onnx 8 590.97 592.01 -0.18%
bert-mrpc-tf 1 290.58 281.28 3.31% 🔆
pytorch-examples-wlang-gru 1 332.41 339.16 -1.99%
pytorch-examples-wlang-lstm 1 298.19 298.76 -0.19%
torchvision-resnet50_1 1 454.52 456.46 -0.42%
cadene-dpn92_1 1 245.05 244.33 0.30%
cadene-resnext101_1 1 189.07 189.19 -0.07%
onnx-taau-downsample 1 204.18 204.02 0.08%
dlrm-criteoterabyte 1 22.29 22.29 0.03%
dlrm-criteoterabyte_fp16 1 41.62 41.58 0.10%
agentmodel 1 6,093.73 6,131.58 -0.62%
unet_fp16 2 33.74 34.27 -1.57%
resnet50v1_fp16 1 551.13 559.90 -1.57%
resnet50v1_int8 1 463.46 462.93 0.11%
bert_base_cased_fp16 64 620.61 623.40 -0.45%
bert_large_uncased_fp16 32 193.77 194.19 -0.22%
bert_large_fp16 1 103.93 104.03 -0.10%
distilgpt2_fp16 16 1,187.58 1,191.27 -0.31%
yolov5s 1 298.31 298.33 -0.01%
tinyllama 1 23.32 23.33 -0.03%
vicuna-fastchat 1 133.67 132.94 0.55%
whisper-tiny-encoder 1 241.13 240.77 0.15%
whisper-tiny-decoder 1 245.45 245.54 -0.04%

Check results before merge 🔆

@migraphx-bot
Copy link
Collaborator

migraphx-bot commented May 3, 2024


     ✅ bert-mrpc-onnx: PASSED: MIGraphX meets tolerance

     ✅ bert-mrpc-tf: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-gru: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-lstm: PASSED: MIGraphX meets tolerance

     ✅ torchvision-resnet50_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-dpn92_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-resnext101_1: PASSED: MIGraphX meets tolerance

     ✅ dlrm-criteoterabyte: PASSED: MIGraphX meets tolerance

     ✅ agentmodel: PASSED: MIGraphX meets tolerance

     ✅ unet: PASSED: MIGraphX meets tolerance

     ✅ resnet50v1: PASSED: MIGraphX meets tolerance

     ✅ bert_base_cased_fp16: PASSED: MIGraphX meets tolerance

🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output


     ✅ bert_large: PASSED: MIGraphX meets tolerance

     ✅ yolov5s: PASSED: MIGraphX meets tolerance

     ✅ tinyllama: PASSED: MIGraphX meets tolerance

     ✅ vicuna-fastchat: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-encoder: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-decoder: PASSED: MIGraphX meets tolerance

     ✅ distilgpt2_fp16: PASSED: MIGraphX meets tolerance

@CharlieL7 CharlieL7 marked this pull request as ready for review May 13, 2024 23:58
@CharlieL7 CharlieL7 requested a review from causten as a code owner May 13, 2024 23:58
@CharlieL7 CharlieL7 added the roadmap Tasks to finish for a release label May 14, 2024
@CharlieL7 CharlieL7 requested review from lakhinderwalia and umangyadav and removed request for TedThemistokleous May 14, 2024 17:05
Copy link
Contributor

@lakhinderwalia lakhinderwalia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this PR. Some stylistic changes can be made, and if the check above is redundant (that I asked about), then please remove it.

@causten
Copy link
Collaborator

causten commented May 30, 2024

Dont forget to fix the format issue

@CharlieL7 CharlieL7 removed the request for review from causten May 30, 2024 16:42
@CharlieL7 CharlieL7 requested a review from umangyadav May 30, 2024 19:54
Comment on lines +181 to +183
auto split_axis_is_fixed = [&]() {
return input_shape.dyn_dims().at(tuned_axis).is_fixed();
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can simply be a bool variable.

Comment on lines +135 to +136
vec_splits.resize(num_outputs - 1, chunk_size);
vec_splits.push_back(last_chunk_size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can potentially lead to resizing and memory allocation twice for the vector. Ideally, you can allocate vector for the splits once for the size (num_outputs) and then put values in that

@causten causten merged commit 6b79d4e into develop May 31, 2024
45 checks passed
@causten causten deleted the split_dyn_parsing branch May 31, 2024 20:52
lajagapp pushed a commit to lajagapp/AMDMIGraphX that referenced this pull request Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap Tasks to finish for a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants